home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’94 / [√] Distribution Restricted! / Steve Sisak / TMFutures / TESampleGlue.a < prev    next >
Text File  |  1994-06-26  |  3KB  |  85 lines

  1. ;
  2. ;    Apple Macintosh Developer Technical Support
  3. ;
  4. ;    MultiFinder-Aware TextEdit Sample Application
  5. ;
  6. ;    TESample
  7. ;
  8. ;    TESampleGlue.a    -    Assembler Source
  9. ;
  10. ;    Copyright © Apple Computer, Inc. 1989-1990
  11. ;    All rights reserved.
  12. ;
  13. ;    Versions:    
  14. ;                1.00                08/88
  15. ;                1.01                11/88
  16. ;                1.02                04/89    MPW 3.1
  17. ;                1.03                02/90    MPW 3.2
  18. ;
  19. ;    Components:
  20. ;                TESample.p            Feb.  1, 1990
  21. ;                TESample.c            Feb.  1, 1990
  22. ;                TESampleGlue.a        Feb.  1, 1990
  23. ;                TESample.r            Feb.  1, 1990
  24. ;                TESample.h            Feb.  1, 1990
  25. ;                [P]TESample.make    Feb.  1, 1990
  26. ;                [C]TESample.make    Feb.  1, 1990
  27. ;
  28. ;    TESample is an example application that demonstrates how 
  29. ;    to initialize the commonly used toolbox managers, operate 
  30. ;    successfully under MultiFinder, handle desk accessories and 
  31. ;    create, grow, and zoom windows. The fundamental TextEdit 
  32. ;    toolbox calls and TextEdit autoscroll are demonstrated. It 
  33. ;    also shows how to create and maintain scrollbar controls.
  34. ;
  35. ;    It does not by any means demonstrate all the techniques you 
  36. ;    need for a large application. In particular, Sample does not 
  37. ;    cover exception handling, multiple windows/documents, 
  38. ;    sophisticated memory management, printing, or undo. All of 
  39. ;    these are vital parts of a normal full-sized application.
  40. ;
  41. ;    This application is an example of the form of a Macintosh 
  42. ;    application; it is NOT a template. It is NOT intended to be 
  43. ;    used as a foundation for the next world-class, best-selling, 
  44. ;    600K application. A stick figure drawing of the human body may 
  45. ;    be a good example of the form for a painting, but that does not 
  46. ;    mean it should be used as the basis for the next Mona Lisa.
  47. ;
  48. ;    We recommend that you review this program or Sample before 
  49. ;    beginning a new application. Sample is a simple app. which doesn’t 
  50. ;    use TextEdit or the Control Manager.
  51. ;
  52.  
  53. ;
  54. ;    AsmClikLoop
  55. ;
  56. ;    This routine gets called by the TextEdit Manager from TEClick.
  57. ;    It calls the old, default click loop routine that scrolls the
  58. ;    text, and then calls our own Pascal routine that handles
  59. ;    tracking the scroll bars to follow along.  It doesn't bother
  60. ;    with saving registers A0 and D0, because they are trashed
  61. ;    anyway by TextEdit.
  62. ;
  63.  
  64. AsmClikLoop    PROC        EXPORT
  65.  
  66.             IMPORT        GETOLDCLIKLOOP
  67.             IMPORT        PASCALCLIKLOOP
  68.             
  69.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  70.             CLR.L        -(SP)                ; make space for procedure pointer
  71.             JSR            GETOLDCLIKLOOP        ; get the old clikLoop
  72.             MOVEA.L        (SP)+,A0            ; into A0
  73.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  74.             
  75.             JSR            (A0)                ; and execute old clikLoop
  76.  
  77.             MOVEM.L        D1-D2/A1,-(SP)        ; D0 and A0 need not be saved
  78.             JSR            PASCALCLIKLOOP        ; do our clikLoop
  79.             MOVEM.L        (SP)+,D1-D2/A1        ; restore the world as it was
  80.             MOVEQ        #1,D0                ; clear the zero flag so TextEdit keeps going
  81.             RTS
  82.  
  83.             END 
  84.  
  85.